1. Field of the Invention
The present invention relates to a data processing apparatus and method for moving data between registers and memory.
2. Description of the Prior Art
An access instruction used to move data between registers and memory will have a start address associated therewith identifying a location within the memory from which the access operation used to implement the access instruction should begin. The access instruction may be a load instruction used to load data from memory into the registers, or a store instruction used to store data from the registers to the memory.
Typically, the minimum size of data which can be moved between the memory and registers is one byte of data. Consequently, addresses are typically specified in units of bytes. It is known to provide an access instruction which specifies that the start address is to be treated as byte aligned, often also referred to as an unaligned access. It is also known to provide an access instruction which specifies that the start address has a predetermined natural alignment as specified by the particular architecture in which the instruction is being used. As an example, if the architecture specifies that the size of data the subject of such access instructions is 64-bits in length, then an instruction which assumes that the start address is naturally aligned will assume that the start address for the access is a multiple of 64 bits, i.e. that the least significant three bits of the start address are all zeros.
Whilst the ability to specify an aligned access in the above manner is beneficial, since an access operation based on a start address which is aligned can typically be performed more quickly than an access operation based on a start address which is unaligned, the above approach is relatively inflexible. In particular, the understanding of what is meant by the term “aligned” is fixed at the architectural level for a particular transfer size. This lack of flexibility is compounded particularly in situations where it is desired that the amount of data to be transferred by an access operation can be varied.
Accordingly, it would be desirable to provide a more flexible technique for performing aligned access operations.